<%@page import="org.yate.oa.model.LoginEntity"%>
<%@page import="java.text.SimpleDateFormat, java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="${pageContext.request.contextPath}" var="ctx" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>产品列表</title>
<link href="${ctx}/css/skin.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/jquery.multiselect.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/prettify.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/multiselect/jquery-ui.min.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/backOffice.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.ui.core.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.ui.widget.js"></script>
<script type="text/javascript" src="${ctx}/css/multiselect/jquery.multiselect.js"></script>
<script type="text/javascript">
var editor;
$(function(){
    $("#kva").multiselect({
    	//multiple: false,
        noneSelectedText: "==请选择==",
        checkAllText: "全选",
        uncheckAllText: '全不选',
        selectedList:15
    });
    
});
function checkForm(){
	if($("#kva").val()==null){
		alert('请选择容量');
		return;
	}
	addForm.submit();
}
function lowVolChange(t){
	if($('#lowVol').val() == 0){
		$('#boxNum').html('<option value="1" selected="selected">三相</option>');
	} else {
		$('#boxNum').html('<option value="0" selected="selected">单相</option>');
		$('#voltageConf').html('<option value="0">欧式配置</option>');
	}
}
function voltageConfChange(){
	var kva = $('#kva').val();
	if(kva != null && kva.length == 1 && kva[0] != '其他'){
		if(kva[0] > 630 || $('#highVol').val() == 1 || $('#boxNum').val() == 1) {
			$('#voltageConf').html('<option value="0">欧式配置</option>');
		}else{
			$('#voltageConf').html('<option value="0">欧式配置</option><option value="1">美式配置</option>');
		}
		if(kva[0] >= 50 && kva[0] <= 160 && $('#highVol').val() == 0){
			$('#lowVol').html('<option value="0">0.4KV</option><option value="1">0.23KV</option>');
		}else {
			$('#lowVol').html('<option value="0">0.4KV</option>');
			$('#boxNum').html('<option value="1">三相</option>');
		}
		lowVolChange();
		highVolConfChange();
	}
}
function highVolConfChange(){
	var kva = $('#kva').val();
	var highVolConf = $('#highVolConf').val();
	var highVol = $('#highVol').val();
	if(kva != null && kva.length == 1 && kva[0] != '其他'){
		if(kva[0] >= 50 && kva[0] <315 && highVolConf == 0){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option>');
		}
		if(kva[0] >=315 && highVolConf == 0 && highVol == 0){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option><option value="2">一进线、一计量、一出线</option><option value="3">一进线、一计量、一PT、一出线</option>');
		}
		if(kva[0] >=315 && highVolConf == 0 && highVol == 1){
			$('#highVolBoxConf').html('<option value="0">一进出线</option><option value="1">一进线、一出线</option>');
		}
	}
	if(highVolConf == 1){
		$('#highVolBoxConf').html('<option value="4">一进线、一环网、一出线</option>');
	}
}
</script>
</head>
<body>
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="17" height="29" valign="top"
				background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/left-top-right.gif" width="17" height="29" /></td>
			<td width="" height="29" valign="top"
				background="${ctx}/images/content-bg.gif"><table width="100%"
					height="31" border="0" cellpadding="0" cellspacing="0"
					class="left_topbg" id="table2">
					<tr>
						<td height="31"><div class="titlebt">创建产品</div></td>
					</tr>
				</table></td>
			<td width="16" valign="top"
				background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/nav-right-bg.gif" width="16" height="29" /></td>
		</tr>
		<tr>
			<td height="71" valign="middle"
				background="${ctx}/images/mail_leftbg.gif">&nbsp;</td>
			<td valign="top" bgcolor="#F7F8F9"><table width="100%"
					height="138" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td height="13" valign="top">&nbsp;</td>
					</tr>
					<tr>
						<td valign="top">
							<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
								<tr>
									<td class="left_txt">当前位置：高压开关柜-创建产品</td>
								</tr>
								<tr>
									<td height="20">
										<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
											<tr>
												<td></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td width="100%" valign="top"
										style="min-height: 350px; height: 350px;">
										<form action="${ctx}/highVolCabinet/post" method="post" name="addForm">
											<table class="tblBill" cellpadding="0" cellspacing="0">
												<tr>
													<td width="15%">容量(KVA)：</td>
													<td>
														<select id ="kva" name="kva" title="Basic example" multiple="multiple" onchange="voltageConfChange()">
															<option value="50">50</option>
															<option value="80">80</option>
															<option value="100">100</option>
															<option value="125">125</option>
															<option value="160">160</option>
															<option value="200">200</option>
															<option value="250">250</option>
															<option value="315">315</option>
															<option value="400">400</option>
															<option value="500">500</option>
															<option value="630">630</option>
															<option value="800">800</option>
															<option value="1000">1000</option>
															<option value="其他">其他</option>
														</select>
													</td>
												</tr>
												<tr>
													<td colspan="2">电压等级</td>
												</tr>
												<tr>
													<td align="right">高压：</td>
													<td>
														<select name="highVol" id="highVol" onchange="voltageConfChange()">
															<option value="0">10KV</option>
															<option value="1">20KV</option>
														</select>
													</td>
												</tr>
												<tr>
													<td align="right">低压：</td>
													<td>
														<select name="lowVol" id="lowVol" onchange="lowVolChange(this)">
															<option value="0">0.4KV</option>
															<option value="1" selected="selected">0.23KV</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>相数：</td>
													<td>
														<select name="boxNum" id="boxNum">
															<option value="0" selected="selected">单相</option>
															<option value="1">三相</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>高压配置型式：</td>
													<td>
														<select name="highVolConf" id="highVolConf" onchange="highVolConfChange()">
															<option value="0">终端型</option>
															<option value="1">环网型</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>变压器配置型式：</td>
													<td>
														<select name="voltageConf" id="voltageConf">
															<option value="0" selected="selected">欧式配置</option>
															<option value="1">美式配置</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>高压开关柜配置：</td>
													<td>
														<select name="highVolBoxConf" id="highVolBoxConf">
															<option value="0">一进出线</option>
															<option value="1">一进线、一出线</option>
															<option value="2">一进线、一计量、一出线</option>
															<option value="3">一进线、一计量、一PT、一出线</option>
															<option value="4">一进线、一环网、一出线</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>品牌：</td>
													<td>
														<select name="brand" id="brand">
															<option value="0">ABB</option>
															<option value="1">深圳飞越</option>
															<option value="2">亚洲电力</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>开关操作机构：</td>
													<td>
														<select name="operationCode" id="operationCode">
															<option value="0">手动</option>
															<option value="1">带电操</option>
														</select>
													</td>
												</tr>
												<tr>
													<td>配置数据：</td>
													<td><textarea tabindex='7' name="detail" id="ta_qa_content" style="width:720px;"></textarea></td>
												</tr>
												<tr>
													<td><input type="hidden" name="submitType" value="add" /></td>
													<td><input type="button" value="确定 " onclick="checkForm()" /> <input type="button" value="取消 "
														onclick="javascript:location.href='${ctx}/jsp/highVolCabinet/list.jsp'" /></td>
												</tr>
											</table>
										</form>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table></td>
			<td background="${ctx}/images/mail_rightbg.gif">&nbsp;</td>
		</tr>
		<tr>
			<td valign="middle" background="${ctx}/images/mail_leftbg.gif"><img
				src="${ctx}/images/buttom_left2.gif" width="17" height="17" /></td>
			<td height="17" valign="top"
				background="${ctx}/images/buttom_bgs.gif"><img
				src="${ctx}/images/buttom_bgs.gif" width="17" height="17" /></td>
			<td background="${ctx}/images/mail_rightbg.gif"><img
				src="${ctx}/images/buttom_right2.gif" width="16" height="17" /></td>
		</tr>
	</table>
</body>
</html>